{include file="header" /}
<!--
        	作者：zhuting
        	时间：2017-09-17
        	描述：页面内容区域
      -->

<!--<img src="../../static/index/img/new.png" alt="图标" />-->
<table style="width: 100%;">
	<td>
		<div style="width:75%; height:100%;">
			<form method="post" class="form" >

				<div class="input-group" style="width:80%">
					<span class="input-group-addon">标题</span>
					<input type="text" class="form-control" id="theme" name="theme" value="{$theme}">
					<span class="input-group-addon">（上限50字）</span>
				</div>

				<!-- 加载编辑器的容器 -->
				<script id="container" name="content" type="text/plain" >
				</script>
				<!-- 配置文件 -->
				<script type="text/javascript" src="../../static/utf8-php/ueditor.config.js"></script>
				<!-- 编辑器源码文件 -->
				<script type="text/javascript" src="../../static/utf8-php/ueditor.all.js"></script>
				<!-- 实例化编辑器 -->
				<script type="text/javascript">
					var ue = UE.getEditor('container', {
//						toolbars: [
//							['undo', 'redo'],
//							['insertimage', ]
//						],
						autoHeightEnabled: false,
						autoFloatEnabled: true
					});
				</script>
				<br>
				<div class="btn-group">

					<INPUT type="button" class="btn" onclick="add()" value=" 提交 ">
				</div>
				<br>
			</form>
		</div>
	</td>
	<td style="width: 20%;">
		<img src="../../static/index/img/author.png" />
	</td>
</table>
<script type="text/javascript">
	function add() {
		$.ajax({
			type: "post",
			url: "add",
			async: true,
			cache: false,
			data: {
				'txt':ue.getContentTxt(),
				'theme':$("#theme").val()
			},
			success: function(data) {
				alert("发表成功！");
				window.location.href = "../../index/dynamics/post";
			},
			error: function() {
				alert("服务器出错了");
			}
		});
	}
</script>
{include file="footer" /}